using UnityEngine;
using System.Collections;

public class BombScript : MonoBehaviour {
	
	
	public int moveSpeed = 300;
	public Vector3 newPosition;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () 
	{
	
		newPosition = new Vector3(0,-1,0) * (moveSpeed * Time.deltaTime);
		newPosition = transform.position + newPosition;
		newPosition.z = Mathf.Clamp(newPosition.z, -0, 0);
		transform.position = newPosition;
		
		if(newPosition.y < -550)
		{
			Destroy(transform.gameObject);
			PlayerScript.lives--;
		}
	}
	
	void OnCollisionEnter(Collision player)
	{
		if(player.gameObject.name == "Player")
		{
		Destroy(transform.gameObject);
		PlayerScript.score += 100;
		}
	}	
	
	
}
